package org.grow.leave.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.grow.leave.entity.enums.ApplyState;
import org.grow.leave.entity.enums.AuditState;
import org.grow.leave.entity.enums.LeaveType;

/**
    * 请假单
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "LeaveBill")
public class LeaveBill {
//    后端自增长
    @TableId(value = "leaveId", type = IdType.AUTO)
    private Integer leaveId;

//    谁操作此处填写谁 不是由前段传入
    @TableField(value = "applier")
    private String applier;
    @TableField(value = "applyTime")
    private LocalDateTime applyTime;
    @TableField(value = "auditor")
    private String auditor;
    @TableField(value = "auditTime")
    private LocalDateTime auditTime;

    @TableField(value = "applyState")
    private ApplyState applyState = ApplyState.saved;

    @TableField(value = "auditState")
    private AuditState auditState =AuditState.notAudit;

    @TableLogic(value = "0",delval = "1")
    @TableField(value = "deleted")
    private Boolean deleted;

    @Version
    @TableField(value = "version")
    private Integer version;

//    下面
    @TableField(value = "startTime")
    private LocalDateTime startTime;

    @TableField(value = "endTime")
    private LocalDateTime endTime;

    @TableField(value = "reason")
    private String reason;

    @TableField(value = "auditWord")
    private String auditWord;

    @TableField(value = "leaveType")
    private LeaveType leaveType;






}